package com.example.logistics_manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.logistics_manage.pojo.User;
import com.example.logistics_manage.pojo.Vehicle;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface VehicleMapper extends BaseMapper<Vehicle> {
    int updateVehicleById(Vehicle vehicle);

    IPage<Vehicle> findAllVehicle(IPage<Vehicle> page);

    IPage<Vehicle> findByVehicleNum(IPage<Vehicle> page,@Param("vehicleNum") String vehicleNum);

    IPage<Vehicle> findByDriverName(IPage<Vehicle> page,@Param("driverName")String driverName);

    IPage<Vehicle> findByCarrierName(IPage<Vehicle> page,@Param("carrierName")String carrierName);

    List<Vehicle> findReadyExamData();

    int examDriver(@Param("user") User user,@Param("vehicleId")Integer vehicleId);
}
